package com.db;

import java.sql.Driver;
import java.sql.DriverManager;

import static java.lang.Math.abs;

/**
 * @author Eugene K.
 * Main Class for demo app.
 */
public class App {
    public static void main(final String... args) {
        final Employee e = new Boss();
        System.out.println( Boss.getHolidays() );

        Superman.callTheOne().setName("reretr");

        Employee[] arr = { new Employee(), new Boss() };
        for(Employee emp : arr) {
            emp.fire();
        }
    }
}

class Employee {
    private int id;
    private int age;
    protected String name;

    Employee(int id) {
        this.id = id;
    }

    public void setId(int id) {
       this.id = id;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void fire() {
        System.out.println("FIRED!!!!!!!!!!!!!!!!");
    }

    public static String getHolidays() {
        return "Mo";
    }

}

class Boss extends Employee {
    public static final String CAR_MARK = "BenMW";

    static {

    }

    {
         setName("ggg");
    }

    @Override
    public void setName(String name) {
        if(name.startsWith("Mr. ")) throw new IllegalArgumentException();
        super.setName(name);
    }


    public static String getHolidays() {
        abs(5);
        return "Mo-Fr";
    }
}

final class Clr {
    public static final Clr RED = new Clr();
    public static final Clr GREEN = new Clr();
    public static final Clr BLUE = new Clr();

    private Clr() { }
}

class Superman {
    public static Superman theOne;
    private String name;

    private Superman() { }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static final Superman callTheOne() {
        if(theOne == null) theOne = new Superman();
        return theOne;
    }
}

class Janitor extends Employee {
    Janitor(String name) {
        super(555);
        this.name = name;
    }
}














